#!/usr/bin/env python
# encoding: utf-8
"""
@author: shura
@position: saber
@contact: 2209032305@qq.com
@file: url.py
@time: 2019/3/9 11:01
@desc:
"""
import math
n = int(input())
def is3sum(s):
    i, j = 1, math.ceil(s**(1/2))
    while i <= j:
        if i**3 + j**3 > s:
            j -= 1
        elif i**3 + j**3 < s:
            i += 1
        else:
            return True
    return False
for _ in range(n):
    line = int(input())
    if is3sum(line):
        print("Yes")
    else:
        print("No")

